var status = -1;

function action(c, b, a) {
    if (c == 1) {
        status++
    } else {
        if (status == 0) {
            cm.dispose()
        }
        status--
    }
    if (status == 0) {
        cm.dispose();
        cm.openNpc(9400371, "GM总换")
    }
}

function start() {
    status = -1;
    action(1, 0, 0)
};